<!--线上观摩-->
<template>
  <section class="bg-white">
    <fetchData class="bg-white" :loading="isLoading" :data="data"></fetchData>
    <div class="d-scroll" style="">
      <div class="demo-site">
        <div class="item" @click="go(item)" v-for="item in data">
          <div class="img-wrap">
            <img v-if="!item.listPic" src="../../../../../static/images/dangjian/home/more-video-cover.jpg" alt="">
            <img v-if="item.listPic" :src="getPoster(item)" alt="">
            <div class="sign-wrap">
              <div class="text" v-if="item.isRecommendNow === 1">{{item.dgwName}}·本周推荐</div>
            </div>
          </div>
          <div class="title">{{item.groupName}}</div>
          <div class="ft">
            <div class="look" v-if="false"><i class="icon" style="margin-left: 20px"><img src="../../../../../static/images/dangjian/home/workingTrends/views.png"
                                                   alt=""></i>{{item.views}}</div>
            <div class="look" style="margin-right: 20px"><i class="icon"><img src="../../../../../static/images/dangjian/home/workingTrends/up.png"
                                                   alt=""></i>{{item.ups}}</div>
          </div>
        </div>
      </div>
<!--      <noData :loading="isLoading" :data="data" v-if="!isLoading && data.length <= 0"></noData>-->
      <div :loading="isLoading" :data="data" v-if="!isLoading && data.length <= 0" class="text-center no-data pdv-10">
        <p class="pdv-10"></p>
        <img src="../../../../../static/images/no_data.png"/>

        <p>暂无数据</p>
      </div>
    </div>

  </section>
</template>

<script>
  export default {
    name: 'demoSite',
    data () {
      return {
        data: [],
        isLoading: true
      }
    },
    created () {
      this.$store.state.demoHonor_tabIndex = 0
      this.loadData()
    },
    methods: {
      go (item) {
        this.$router.push({name: 'demoObserve', query: {partyGroupId: item.groupId, groupName: item.groupName, dgwName: item.dgwName, isRecommendNow: item.isRecommendNow,currRecommend:true}})
      },
      loadData () {
        this.isLoading = true
        let data = {
        }
        this.fetchService.recommendRecord(data).then((res) => {
          console.log(res.data)
          this.isLoading = false
          if (res.code !== 0) {
            return this.tools.tip(res.message || '接口服务出错，请联系管理员')
          }
          this.data = res.data
        })
      },
      getPoster (item) {
        return this.tools.getImgUrl(item.listPic)
      }
    }
  }
</script>

<style scoped>
 p{
   font-size: 16PX;
 }
</style>
